package com.billionsfinance.hessian.controller;

import com.billionsfinance.hessian.server.DemoServer;
import com.billionsfinance.hessian.server.HelloServer;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class HelloController {

    @Resource
    private HelloServer helloServer;

    @Resource
    private DemoServer demoServer;

    @RequestMapping("/hello")
    public String hello() {
        return helloServer.sayHello("zhang");
    }

    @RequestMapping("/demo")
    public int demo() {
        return demoServer.add(5, 10);
    }
}
